<template>
	<div>
		<dialog :open="bopens"
			style="background: turquoise; width: 20vh; height: 1vh;color: greenyellow; text-align: center; border: 1px solid #42B983;">
			{{ errmsg }}
		</dialog>
	</div>
</template>

<script>
export default {
	data() {
		return {
			bopen: false,
		}
	},
	computed: {
		bopens() {
			return this.$store.state.erropen > 0;
		}
		,
		errmsg() {
			return this.$store.state.msg
		}
	},
	watch: {
		errmsg: {
			msg(new1, old) {
				this.bopen = true
			}
		}
	},
	mounted() {
		setInterval(() => {
			this.$store.state.erropen -= 1;
		}, 1000)
	}
}
</script>

<style></style>
